﻿using System.Linq;
using System.Web.Mvc;
using SklepISI.Core.Interfaces;
using SklepISI.Web.Models;

namespace SklepISI.Web.Controllers
{
    public class HomeController : Controller
    {
        private IProductRepository _productRepository;
        public HomeController(IProductRepository productRepository)
        {
            _productRepository = productRepository;
        }

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ListCategories()
        {
            var categories = _productRepository.GetCategories();
            return PartialView("_Categories", categories);
        }

    }
}
